package cas.ihep.jni;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.ObjectInput;
import java.io.ObjectOutput;

/**
 * Created by gesturewei on 16-10-6.
 */
public final class HepEventNativeInterface {

    static {
        System.loadLibrary("PlanC");
    }
    private HepEventNativeInterface(){}

    public static native int create0(int id,String name,int type,int len,int flag);
    public static native void unlink0(int id);
    public static native void dispose0(int id);

    public static native int nativeGetEventData0(int id,DataOutput ostrm)throws java.io.IOException;
    public static native int nativeSetEventData0(int id,DataInput istrm)throws java.io.IOException;

    public static native int nativeGetObjectData0(int id, ObjectOutput ostrm)throws java.io.IOException;
    public static native int nativeSetObjectData0(int id, ObjectInput istrm) throws java.io.IOException;

    public static native int nativeGetPhysicalSize(int id);
    public static native int nativeGetPackedSize(int id);
    public static native short nativeGetNumberOfEvents(int id);
    public static native short nativeGetPackingAlgorithm(int id);
    public static native int nativeGetVersion(int id);

    public static native void nativeSetPhysicalSize(int id,int val);
    public static native void nativeSetPackedSize(int id,int val);
    public static native void nativeSetNumberOfEvents(int id,short val);
    public static native void nativeSetPackingAlgorithm(int id,short val);
    public static native void nativeSetVersion(int id,int val);
    public static native int getpid();
}
